<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="jakarta.tags.core" %>
<html>
<head>
    <title>同学录</title>
    <style>
        table, th, td {
            border: 1px solid black;
            border-collapse: collapse;
            padding: 8px;
        }
        .action-buttons {
            display: flex;
            gap: 5px;
        }
        .add-button {
            margin-bottom: 15px;
        }
    </style>
</head>
<body>
<h1>同学录</h1>
<a href="addStudent" class="add-button">添加新同学</a>
<table>
    <tr>
        <th>ID</th>
        <th>姓名</th>
        <th>外号</th>
        <th>星座</th>
        <th>联系方式</th>
        <th>我眼中的他</th>
        <th>操作</th>
    </tr>
    <c:forEach items="${students}" var="st">
        <tr>
            <td>${st.id}</td>
            <td>${st.name}</td>
            <td>${st.nickn}</td>
            <td>${st.ast}</td>
            <td>${st.con}</td>
            <td>${st.imp}</td>
            <td class="action-buttons">
                <a href="editStudent?id=${st.id}">编辑</a>
                <a href="deleteStudent?id=${st.id}">删除</a>
            </td>
        </tr>
    </c:forEach>
</table>
</body>
</html>